<%@ page language="java" contentType="text/html; charset=UTF-8"	pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<%@ include file="/common/taglibs.jsp"%>
<%@ include file="/common/meta.jsp"%>
<title>婴儿秀</title>

<script type="text/javascript" src="${ctx }/resource/js/jquery.ui.core.js"></script>
<script type="text/javascript" src="${ctx }/resource/js/jquery.ui.widget.js"></script>
<script type="text/javascript" src="${ctx }/resource/js/jquery.ui.tabs.js"></script>
<script type="text/javascript" src="${ctx }/resource/js/ajaxfileupload.js"></script>
	 <style type="text/css">
      body {
        padding-top: 60px;
        padding-bottom: 40px;
        margging-top:50px;
      }
      
    </style>
</head>

<body >
<%@include file="/common/header.jsp" %>

<div class='container'>
<div class='row'>
个人资料:
<div class='span12 well'>
<div class="pull-left"><a href="#"><img src="${ctx}/resource/images/home/template/avatar.mid.gif" class='img-rounded'/></a></div>
<div class="pull-right btn-group">
  <button class="btn btn-info">广播</button>
   <button class="btn btn-info">粉丝</button>
    <button class="btn btn-info">喜欢</button>
</div>
<div class="pull-right btn-group " style="clear:both">
  <button class="btn ">1</button>
   <button class="btn">2</button>
    <button class="btn">3</button>
</div>
</div>
 
   </div>
<div class='row'>
<div class='span12'></div>
</div>
<%@include file="/common/footer.jsp" %>
</div>

 <script type="text/javascript">
	$(document).ready(function(){			
		 $( "#tabs" ).tabs();
		});
	
	//检查weibo的字符数是否超出
	function checkMsgLimit(){
		var usedLength=$("#message").val().length;
		var maxLength=70;
		 if(usedLength>=maxLength){
			 $("#limitTip").html("字符已经超过，请删除");
			 }else{
				$("#limitTip").html("还可以输入"+(maxLength-usedLength)+"字符");
				 }
		}
	//发布微博
	function pubMessage(){
		$.ajax({
			url:"${ctx}/action/pubMessage",
			data:"message="+$("#message").val(),
			dataType:"json",
			method:"post",
			success:function(data){
				  if(data.flag){
					  alert("发布成功");
					  }else{
						  alert("发布失败"+data.message);
						  }
				}
			});
	}
	//上传图片
function ajaxFileUpload()
	{
		$("#loading")
		.ajaxStart(function(){
			$(this).show();
		})
		.ajaxComplete(function(){
			$(this).hide();
		});
	
		$.ajaxFileUpload
		(
			{
				url:'${ctx}/action/shareImage',
				secureuri:false,
				fileElementId:'uploadImages',
				data:{"photo.title":$("#title").val(),"photo.tags":$("#tags").val(),"photo.link":$("#link").val()},
				dataType: 'json',
				success: function (data, status)
				{
						if(data.flag)
						{
							alert("分享成功");
						}else
						{
							alert(data.message);
						}
				},
				error: function (data, status, e)
				{
					alert(e);
				}
			}
		);
		
		return false;

	}
</script>

</body>
</html>
